import {defineStore} from 'pinia';
import {getBaseCategoryList} from '@/api/product';

export const useProductStore = defineStore('product', {
	state: () => {
		return {
			categoryList: [],
		}
	},
	getters: {},
	actions: {
		loadCategoryList() {
			if (this.categoryList?.length > 0) {
				return;
			}
			getBaseCategoryList().then(({data}) => {
				this.categoryList = data
			})
		}
	}
})
